package com.example.demo.controller;

import com.example.demo.dao.BaoWaiDanDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class BaoWaiDanController {
    @Autowired
    BaoWaiDanDao baoWaiDan;

    @PostMapping("/del_baowaidan")
    public int del_baowaidan(@RequestBody Map map){
        return baoWaiDan.del_baowaidan(map);
    }

    @PostMapping("/add_baowaidan")
    public int add_baowaidan(@RequestBody Map map){
        return baoWaiDan.add_baowaidan(map);
    }

    @PostMapping("/find_all_baowaidan")
    public List<Map> find_all_baowaidan(@RequestBody Map map) throws InterruptedException {

        return baoWaiDan.find_all_baowaidan(map);
    }
}
